﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using BMS.Visitor.DL;

namespace BMS.VISITORS.DESKTOP.Content
{
    // taken from MSDN (http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid.aspx)
    public enum OrderStatus { None, New, Processing, Shipped, Received };
    public class Customer
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string Email { get; set; }
        public bool IsMember { get; set; }
        public OrderStatus Status { get; set; }
    }

    /// <summary>
    /// Interaction logic for ControlsStylesDataGrid.xaml
    /// </summary>
    public partial class VisitorDataGrid : UserControl
    {

        public VisitorDataGrid()
        {
            InitializeComponent();

            ObservableCollection<BMS.Visitor.Model.Entities.Visitor> visitorData = GetData();

            //Bind the DataGrid to the customer data
            DG1.DataContext = visitorData;
        }


        private ObservableCollection<BMS.Visitor.Model.Entities.Visitor> GetData()
        {

            // Lógica para almacenar un visitante
            IDataLogic<BMS.Visitor.Model.Entities.Visitor> dataLogicVisitor = new VisitorDataLogic();

            var visitors = new ObservableCollection<BMS.Visitor.Model.Entities.Visitor>();

            foreach (var visit in dataLogicVisitor.List())
            {
                visitors.Add(visit);
            }

            return visitors;
        }
    }

}
